﻿using System.Collections.Generic;
using NHibernate;
using NHibernate.Criterion;

namespace Genesis.Persistence
{

    using Genesis.Domain;
    using Genesis.Domain.Persistence;
    using Genesis.Infrastructure.Persistence;

    public class ForumRepository : Repository<Forum>, IForumRepository
    {

        public IEnumerable<Forum> SelectRoots()
        {

            ICriteria criteria = Session.CreateCriteria<Forum>();

            criteria.Add(Expression.Sql("ForumId IS NULL"));

            return criteria.Future<Forum>();
            
        }
    
    }

}